#include "ScnsKey.c.h"

#if defined(SCNS_KEY_ENABLE)&&SCNS_KEY_ENABLE==1

#include "ScnsMenu.h"
#include "ScnsLed.h"
#include "ScnsBeep.h"

static void handler(ScnsKeyMsg msg)
{
    if(msg.status==SCNS_KEY_PRESS_DOWN)
    {
        scnsBeepAdd("S");
    }
    if(msg.status==SCNS_KEY_PRESS_HOLD)
    {
        scnsBeepAdd("L");
    }
}

extern void lvglLedKeyHandler(ScnsKeyMsg msg);

const ScnsBspKeyConfig scnsBspKeyConfig[SCNS_KEY_MAX]={
    [SCNS_KEY_PC13]={.name="PC13",.callbacks=NULL},

    [SCNS_KEY_S13]={.name="S13",.callbacks=(void (*[])(ScnsKeyMsg)){handler,NULL}},
    [SCNS_KEY_S14]={.name="S14",.callbacks=NULL},
    [SCNS_KEY_S15]={.name="S15",.callbacks=NULL},
    [SCNS_KEY_S16]={.name="S16",.callbacks=NULL},
    [SCNS_KEY_S17]={.name="S17",.callbacks=NULL},
    [SCNS_KEY_S7]={.name="S7",.callbacks=NULL},
    [SCNS_KEY_S8]={.name="S8",.callbacks=NULL},
    [SCNS_KEY_S9]={.name="S9",.callbacks=NULL},
    [SCNS_KEY_S10]={.name="S10",.callbacks=NULL},
    [SCNS_KEY_S11]={.name="S11",.callbacks=NULL},
    [SCNS_KEY_S1]={.name="S1",.callbacks=NULL},
    [SCNS_KEY_S2]={.name="S2",.callbacks=NULL},
    [SCNS_KEY_S3]={.name="S3",.callbacks=NULL},
    [SCNS_KEY_S4]={.name="S4",.callbacks=NULL},
    [SCNS_KEY_S5]={.name="S5",.callbacks=NULL},

    [SCNS_KEY_STB0_S1]={.name="T0S1",.callbacks=(void (*[])(ScnsKeyMsg)){handler,NULL}},
    [SCNS_KEY_STB0_S2]={.name="T0S2",.callbacks=(void (*[])(ScnsKeyMsg)){handler,NULL}},
    [SCNS_KEY_STB0_S3]={.name="T0S3",.callbacks=(void (*[])(ScnsKeyMsg)){handler,NULL}},
    [SCNS_KEY_STB0_S4]={.name="T0S4",.callbacks=(void (*[])(ScnsKeyMsg)){handler,NULL}},
    [SCNS_KEY_STB0_S5]={.name="T0S5",.callbacks=(void (*[])(ScnsKeyMsg)){handler,NULL}},
    [SCNS_KEY_STB0_S6]={.name="T0S6",.callbacks=(void (*[])(ScnsKeyMsg)){handler,NULL}},
    [SCNS_KEY_STB0_S7]={.name="T0S7",.callbacks=(void (*[])(ScnsKeyMsg)){handler,NULL}},
    [SCNS_KEY_STB0_S8]={.name="T0S8",.callbacks=(void (*[])(ScnsKeyMsg)){handler,NULL}},
    [SCNS_KEY_STB0_S9]={.name="T0S9",.callbacks=(void (*[])(ScnsKeyMsg)){handler,NULL}},
    [SCNS_KEY_STB0_S10]={.name="T0S10",.callbacks=(void (*[])(ScnsKeyMsg)){handler,NULL}},
    [SCNS_KEY_STB0_S11]={.name="T0S11",.callbacks=(void (*[])(ScnsKeyMsg)){handler,NULL}},
    [SCNS_KEY_STB0_S12]={.name="T0S12",.callbacks=(void (*[])(ScnsKeyMsg)){handler,NULL}},
    [SCNS_KEY_STB0_S13]={.name="T0S13",.callbacks=(void (*[])(ScnsKeyMsg)){handler,NULL}},
    [SCNS_KEY_STB0_S14]={.name="T0S14",.callbacks=(void (*[])(ScnsKeyMsg)){handler,NULL}},
    [SCNS_KEY_STB0_S15]={.name="T0S15",.callbacks=(void (*[])(ScnsKeyMsg)){handler,NULL}},
    [SCNS_KEY_STB0_S16]={.name="T0S16",.callbacks=(void (*[])(ScnsKeyMsg)){handler,NULL}},
    [SCNS_KEY_STB0_S17]={.name="T0S17",.callbacks=(void (*[])(ScnsKeyMsg)){handler,NULL}},
    [SCNS_KEY_STB0_S18]={.name="T0S18",.callbacks=(void (*[])(ScnsKeyMsg)){handler,NULL}},
    [SCNS_KEY_STB0_S19]={.name="T0S19",.callbacks=(void (*[])(ScnsKeyMsg)){handler,NULL}},
    [SCNS_KEY_STB0_S20]={.name="T0S20",.callbacks=(void (*[])(ScnsKeyMsg)){handler,NULL}},
    [SCNS_KEY_STB0_S21]={.name="T0S21",.callbacks=(void (*[])(ScnsKeyMsg)){handler,NULL}},
    [SCNS_KEY_STB0_S22]={.name="T0S22",.callbacks=(void (*[])(ScnsKeyMsg)){handler,NULL}},
    [SCNS_KEY_STB0_S23]={.name="T0S23",.callbacks=(void (*[])(ScnsKeyMsg)){handler,NULL}},
    [SCNS_KEY_STB0_S24]={.name="T0S24",.callbacks=(void (*[])(ScnsKeyMsg)){handler,NULL}},
};

#endif
